/**
 *
 */
package com.edooschool.webpay.entity.config;

import org.apache.commons.lang3.StringUtils;

import com.demo2do.core.wechat.entity.pay.PayConfig;

/**
 * @author downpour
 *
 */
public class WechatpayConfig implements PayConfig {

    private String appid;

    private String sellerId;

    private String notifyUrl;

    private String remoteIp;

    /**
     * 
     * @param appid
     * @param partnerId
     */
    public WechatpayConfig(String appid, String partnerId) {
        this.appid = appid;
        this.sellerId = partnerId;
    }
    
    /**
     * 
     * @param appid
     * @param partnerId
     * @param notifyUrl
     * @param remoteIp
     */
    public WechatpayConfig(String appid, String partnerId, String notifyUrl, String remoteIp) {
        this.appid = appid;
        this.sellerId = partnerId;
        this.notifyUrl = notifyUrl;
        this.remoteIp = remoteIp;
    }

    /* (non-Javadoc)
     * @see com.demo2do.core.wechat.entity.pay.PayConfig#getAppid()
     */
    public String getAppid() {
        return this.appid;
    }
    
    /* (non-Javadoc)
     * @see com.demo2do.core.wechat.entity.pay.PayConfig#getSellerId()
     */
    public String getSellerId() {
        return this.sellerId;
    }

    /* (non-Javadoc)
     * @see com.demo2do.core.wechat.entity.pay.PayConfig#getNotifyUrl()
     */
    public String getNotifyUrl() {
        return this.notifyUrl;
    }
    
    /* (non-Javadoc)
     * @see com.demo2do.core.wechat.entity.pay.PayConfig#getRemoteIp()
     */
    public String getRemoteIp() {
        return this.remoteIp;
    }
    
    /* (non-Javadoc)
     * @see com.demo2do.core.wechat.entity.pay.PayConfig#match(java.lang.String, java.lang.String)
     */
    public boolean match(String appid, String sellerId) {
        return StringUtils.equals(this.appid, appid) && StringUtils.equals(this.sellerId, sellerId);
    }
}
